win32: Fix missed resize exit message
authorAlexander Larsson <alexl@redhat.com>
Tue, 25 Oct 2011 13:34:22 +0000 (15:34 +0200)
committerAlexander Larsson <alexl@redhat.com>
Thu, 10 Nov 2011 16:40:59 +0000 (17:40 +0100)
When you start a window resize or move via the window menu and
don't actually change anything we're not getting an exitsizemove.
In order to work around this we also look for WM_CAPTURECHANGED.

gdk/win32/gdkevents-win32.c

index 1113de888788bbe2173d1d3df93d861e9910f842..1ceeacc57b798580c397ebeebf7701eb308fdb43 100644 (file)
@@ -2665,7 +2665,16 @@ gdk_event_translate (MSG  *msg,
 
     case WM_EXITSIZEMOVE:
     case WM_EXITMENULOOP:
-      _gdk_win32_end_modal_call ();
+      if (_modal_operation_in_progress)
+       _gdk_win32_end_modal_call ();
+      break;
+
+    case WM_CAPTURECHANGED:
+      /* Sometimes we don't get WM_EXITSIZEMOVE, for instance when you
+        select move/size in the menu and then click somewhere without
+        moving/resizing. We work around this using WM_CAPTURECHANGED. */
+      if (_modal_operation_in_progress)
+       _gdk_win32_end_modal_call ();
       break;
 
     case WM_WINDOWPOSCHANGING: